#include "DataStructure/Input/Constraint/RJOINTData.h"

#include "DataStructure/Input/Solver/DOFDirections.h"

using namespace SG::DataStructure;

/**
 * @brief 获取主自由度集
 *
 * 返回主自由度集的引用。
 *
 * @return 主自由度集的引用
 */
SG::DataStructure::FEM::DofSet FEM::RJOINTData::GetMasterDOFs () const
{
    return Int2VDofSet (m_masterDOFs);
}
void FEM::RJOINTData::SetMasterDOFs (const SG::DataStructure::FEM::DofSet& dofs)
{
    m_masterDOFs = DofSet2Int (dofs);
}

/// @brief 判断两个RJOINTData是否相等
/// @param a
/// @param b
/// @return
bool SG::DataStructure::FEM::operator== (const RJOINTData& a, const RJOINTData& b)
{
    if (a.m_id != b.m_id)
    {
        return false;
    }
    if (a.m_masterNode != b.m_masterNode)
    {
        return false;
    }
    if (a.m_slaveNode != b.m_slaveNode)
    {
        return false;
    }
    if (a.m_masterDOFs != b.m_masterDOFs)
    {
        return false;
    }
    if (a.m_domainId != b.m_domainId)
    {
        return false;
    }
    return true;
}